<template>
<h1>EL-表单</h1>
  <el-form style="width: 500px;margin: 0 auto;" label-width="80">
    <el-form-item label="用户名" >
      <el-input placeholder="请输入用户名"  v-model="user.username"></el-input>
    </el-form-item>

    <el-form-item label="密 码" >
      <el-input placeholder="请输入密码"  v-model="user.password" show-password></el-input>
    </el-form-item>

    <el-form-item label="性 别" >
      <el-radio-group v-model="user.gender">
      <el-radio-button label="男" value="1"></el-radio-button>
      <el-radio-button label="女" value="0"></el-radio-button>
      </el-radio-group>
    </el-form-item>

    <el-form-item label="所在地" >
      <el-select v-model="user.city" placeholder="请输入城市">
        <el-option label="北京" value="bj"></el-option>
        <el-option label="天津" value="tj"></el-option>
        <el-option label="太原" value="bj"></el-option>
        <el-option label="珠海" value="zh"></el-option>
      </el-select>
    </el-form-item>

      <el-form-item label="管理员" >
        <el-switch v-model="user.gly" active-value="1" inactive-value="0"></el-switch>
      </el-form-item>

    <el-form-item  >
      <el-button type="success" @click="tj">点我提交</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import {ref} from "vue";
const user=ref({
  username:'',
  password:'',
  gender:'',
  city:'',
  gly:0
})
const tj=()=>{
  console.log(user.value)
}

</script>


<style scoped>

</style>